package cn.com.blueInfo.bpm.number.entity;

import cn.com.blueInfo.bpm.common.entity.BaseEntity;
import cn.com.blueInfo.bpm.number.enums.NumberSerialResetCycle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 编号规则流水号表
 * @author suxch
 * @since 2025-08-24 01:39:05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "mc_bsn_number_serial", autoResultMap = true)
@Schema(description = "编号规则流水号表")
public class NumberSerial extends BaseEntity {

    /** ID */
    @TableId(type = IdType.INPUT)
    @Schema(description = "ID")
    private Long id;
    /** 规则主表ID */
    @Schema(description = "规则主表ID")
    private Long ruleId;
    /** 组织ID：NULL表示全局流水，非NULL表示按组织独立流水 */
    @Schema(description = "组织ID：NULL表示全局流水，非NULL表示按组织独立流水")
    private Long orgId;
    /** 当前流水号 */
    @Schema(description = "当前流水号")
    private Long currentNum;
    /** 最小流水号 */
    @Schema(description = "最小流水号")
    private Long minNum;
    /** 最大流水号 */
    @Schema(description = "最大流水号")
    private Long maxNum;
    /** 流水号重置周期：NONE-不重置，YEAR-每年重置，MONTH-每月重置，DAY-每天重置 */
    @Schema(description = "流水号重置周期：NONE-不重置，YEAR-每年重置，MONTH-每月重置，DAY-每天重置")
    private NumberSerialResetCycle resetCycle;
    /** 最后一次重置时间 */
    @Schema(description = "最后一次重置时间")
    private LocalDateTime lastResetTime;
    /** 流水号补位格式（如\"000000\"标识6位补0） */
    @Schema(description = "流水号补位格式（如\"000000\"标识6位补0）")
    private String format;

}
